#!/system/bin/sh

#================================================================
#   Copyright (C) 2023 Sangfor Ltd. All rights reserved.
#   
#   文件名称：runtests.sh
#   创 建 者：szmoto, szmoto@vip.qq.com
#   创建日期：2023年08月21日
#   描    述：
#
#================================================================

echo "Running unit tests:"
for i in tests/*_tests
do
    if test -f $i
    then
        if $VALGRIND ./$i 2>> tests/tests.log
        then
            echo $i PASS
        else
            echo "ERROR in test $i: here's tests/tests.log"
            echo "------"
            tail tests/tests.log
            exit 1
        fi
    fi
done
echo ""
